package com.bwie.controller;

import com.bwie.pojo.TbBrand;
import com.bwie.service.TbBrandService;
import com.bwie.utils.Result;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 军哥
 * @version 1.0
 * @description: TODO
 * @date 2025/5/23 13:51
 */

@RestController
@RequestMapping("/shop/index")
public class IndexController {

    @Autowired
    TbBrandService tbBrandService;

    /**
     * 品牌添加
     * @param tbBrand
     * @return
     */
    @PostMapping("/addBrand")
    public Result addBrand(@RequestBody TbBrand tbBrand) {
        return tbBrandService.addBrand(tbBrand);
    }

    /**
     * @description 分页获取品牌列表
     * @params [pageInfoVo]
     * @return com.bwie.utils.Result
     * @author 军哥
     * @date 2025/5/23 13:58
     */
    @PostMapping("/getBrandList")
    public Result getBrandList(@RequestBody PageInfoVo pageInfoVo) {
        return tbBrandService.getBrandList(pageInfoVo);
    }

    /**
     * @description 修改品牌状态
     * @params [tbBrand]
     * @return com.bwie.utils.Result
     * @author 军哥
     * @date 2025/5/24 8:32
     */
    @PostMapping("/updateBrandStatus")
    public Result updateBrandStatus(@RequestBody TbBrand tbBrand) {
        return tbBrandService.updateBrandStatus(tbBrand);
    }

}
